function [ ] = plotTotalCostsAll( ctrM, ctrC, scenarios_toplot,...
    filestub, titlestub, optfig )
% Plot total costs under the emissions market and under the command and
%   control scenario
%
%   INPUTS:
%     ctrM - Counterfactual with emissions market
%     ctrC - Counterfactual with command-and-control scenario
%     period - Period in which to plot
%     E_c_ref  - Reference emissions level in command-and-control

% Plot histogram for each period
for i = 1:size(scenarios_toplot,1)
    
    % Get parameters describing the scenario: period, cap
    t   = scenarios_toplot.id_period(i);
    cap = scenarios_toplot.cap(i);
%     E_c_ref = cap*1.25;
    E_c_ref = 240e3;
    
    filename = [ filestub sprintf('data_%02.0f',t) ];
    title    = [ titlestub sprintf(': period %2.0f',t) ];
    plotTotalCosts( ctrM, ctrC, t, E_c_ref, ...
                    filename, title, optfig )
                
end

end